﻿using System.Linq;
using SimpleNow.Core.Ntiers;
using System.Collections.Generic;

namespace SimpleNow.Core.Localization.Tool
{
    public class LocalizationToolDAL : AbstractDAL
    {
        public void GetGroups()
        {
            using (var db = new LocalizationToolEntities())
            {
                var query = from LocalizationGroupRecord in db.LocalizationGroupRecords
                            select LocalizationGroupRecord;

                foreach (var m in query)
                {
                    int a;
                    a = 1;
                }
            }
        }

        public List<LocalizationLocalizableResourceRecord> GetResourceByGroupId(int GroupId)
        {
            using (var db = new LocalizationToolEntities())
            {
                var query = from LocalizationLocalizableResourceRecord in db.LocalizationLocalizableResourceRecords
                            where LocalizationLocalizableResourceRecord.LocalizationGroupId == GroupId
                            select LocalizationLocalizableResourceRecord;

                return query.ToList();
            }
        }

        public List<LocalizationCultureCodeRecord> GetCultureCode()
        {
            using (var db = new LocalizationToolEntities())
            {
                var query = from LocalizationCultureCodeRecord in db.LocalizationCultureCodeRecords
                            select LocalizationCultureCodeRecord;

                return query.ToList();

            }

        }

        public List<LocalizationStatusRecord> GetStatus()
        {
            using (var db = new LocalizationToolEntities())
            {
                var query = from LocalizationStatusRecord in db.LocalizationStatusRecords
                            select LocalizationStatusRecord;

                return query.ToList();
            }
        }



        public void GetUsageType()
        {
            using (var db = new LocalizationToolEntities())
            {
                var query = from LocalizationUsageTypeRecord in db.LocalizationUsageTypeRecords
                            select LocalizationUsageTypeRecord;

                foreach (var m in query)
                {
                    int a;
                    a = 1;

                }
            }
        }


    }
}
